README FILE FOR 

"A THEORY OF FOREIGN EXCHANGE INTERVENTIONS"

BY SEBASTIAN FANELLI, LUDWIG STRAUB

2021



DATA AVAILABILITY STATEMENT

This paper does not involve analysis of external data (i.e., no data are used or the only data are generated by the authors via simulation in their code). The code generating Figures 1-12 is in this repository.



INSTRUCTIONS

To replicate Figures 1, 2, 3, 4, 5, 8, 10 run main_cts_model.m
To replicate Figure 6 run main_reserve_wars_model.m

In both files, the path for pdflatex needs to be specific at the top. Python needs to be installed as well. Once it is specified, the compiled tikz figures should appear in folder 'tikz_pdfs'. If this does not work, setting write_tikz and compute_pdf to 0 will produce the figures as Matlab figures but not converted into tikz files and pdfs.

Note: If the provided mex files for interpolate_matt do not work on your current operating system, please compile it from interpolate_matt.c directly, which is also provided in the folder.



PDF FILES

Figure 1 consists of the following pdf files:
	Left column:
	 - opt_paper_RERss
	 - opt_paper_tau
	 - opt_paper_nfaGDP
	 - opt_paper_z_R_ss
	Right column:
	 - opt_paper_rstar
	 - opt_paper_resGDP
	 - opt_paper_privnfaGDP
	 - opt_paper_z_h2m_ss

Figure 2 consists of the following pdf files:
	Left column:
	 - smooth_ER_paper_RERss
	 - smooth_ER_paper_tau
	 - smooth_ER_paper_privnfaGDP
	 - smooth_ER_paper_resGDP

Figure 3 consists of the following pdf:
	 - cost

Figure 4 consists of the following pdf files:
	 - fwd_guid_puzzle_paper_RERss
	 - fwd_guid_puzzle_paper_resGDP

Figure 5 consists of the following pdf files:
	 - opt_LC_paper_RERss
	 - opt_LC_paper_tau

Figure 6 consists of the following pdf files:
	Left column:
	 - world_paper_rstar
	 - world_paper_reserves_GDP
	Right column:
	 - world_paper_tau
	 - world_paper_V_EME

Figure 8 consists of the following pdf files:
	 - res_acc_paper_RERss
	 - res_acc_paper_resGDP

Figure 10 consists of the following pdf files:
	Left column:
	 - learning_paper_RERss
	 - learning_paper_tau
	 - learning_paper_nfaGDP
	Right column:
	 - learning_paper_rstar
	 - learning_paper_resGDP
	 - learning_paper_privnfaGDP



SOFTWARE REQUIREMENTS

The replication package was run successfully on a 2017 MacBook Pro, mac OS Catalina with:
 - Matlab R2018a
 - python 3.7.1
 - pdflatex

Only Matlab is necessary to compute the figures within Matlab. Python and pdflatex are only used for compilation of those figures.



RUNTIMES

Runtime is less than 5 minutes.

